import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

Vue.config.productionTip = false

import {getRequest} from "./utils/api";
import {postRequest} from "./utils/api";
import {postKeyValueRequest} from "./utils/api";
import {putRequest} from "./utils/api";
import {deleteRequest} from "./utils/api";

Vue.prototype.$getRequest=getRequest;
Vue.prototype.$postRequest=postRequest;
Vue.prototype.$postKeyValueRequest=postKeyValueRequest;
Vue.prototype.$putRequest=putRequest;
Vue.prototype.$deleteRequest=deleteRequest;

/*解决路由重复点击问题*/
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
Vue.use(mavonEditor)

Vue.prototype.bus=new Vue()

let echarts = require('echarts');

Vue.prototype.$echarts=echarts;

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
